Design by Contract (DbC) and runtime enforcement of program assertionsenables the construction of more robust software. It also enables theassignment of blame in error reporting. Unfortunately, there is no support forruntime contract enforcement and blame assignment for Aspect-OrientedProgramming (AOP). Extending DbC to also cover aspects brings forward aplethora of issues related to the correct order of assertion validation. Weshow that there is no generally correct execution sequence of object assertionsand aspect assertions. A further classification of aspects as agnostic,obedient, or rebellious defines the order of assertion validation that needs tobe followed. We describe the application of this classification in a prototypedDbC tool for AOP named Cona, where aspects are used for implementing contracts,and contracts are used for enforcing assertions on aspects.
展开▼